<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">

      <html>
      <body>

        <xsl:apply-templates select="testResults"/>

      </body>
      </html>

  </xsl:template>
  <xsl:template match="testResults">
    <xsl:apply-templates select="build"/>
  </xsl:template>
  <xsl:template match="build">
    <h1>Time: <xsl:value-of select="@time"/></h1>
    <xsl:for-each select="target">
      <xsl:call-template name="targetTemplate"/>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="targetTemplate">
<font size="6" color="green" id="{@name}"><b><xsl:value-of select="@name"/> (time: <xsl:value-of select="@time"/>)</b></font><br/>
    <xsl:for-each select="task">
      <xsl:call-template name="taskTemplate"/>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template name="taskTemplate">
<font color="blue"><b>Task: <xsl:value-of select="@name"/> (time: <xsl:value-of select="@time"/>)</b></font><br/>
    <xsl:for-each select="message">
      <xsl:call-template name="messageTemplate"/>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="messageTemplate">
<xsl:value-of select="."/><br/>
  </xsl:template>

</xsl:stylesheet> 
